package Demo523;


    import java.sql.*;
import java.util.Scanner;

    public class SqlConnection {
        private static final String URL = "jdbc:mysql://localhost:3306/usersdb";
        private static final String USERNAME = "root";
        private static final String PASSWORD = "123456";

        public static Connection getCon() throws ClassNotFoundException, SQLException {
            Class.forName("com.mysql.cj.jdbc.Driver");
            return DriverManager.getConnection(URL, USERNAME, PASSWORD);
        }
    }

